# coding=utf-8
import time

import yaml
from selenium import webdriver


# 获取cookie
def get_cookies():
    driver = webdriver.Chrome()
    driver.maximize_window()
    driver.get("https://work.weixin.qq.com/wework_admin/loginpage_wx")
    time.sleep(20)
    cookies = driver.get_cookies()
    with open("../data/cookies.yaml","w",encoding="utf-8") as file:
        yaml.safe_dump(cookies, file)
    print(cookies)


if __name__ == '__main__':
    get_cookies()

